﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectSunny.Admin.Controls
{
    public partial class ListAccount : System.Web.UI.UserControl
    {
        public int count = 1;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //Them du lieu vao cat 1
                count = 1;
                rpt_account.DataSource = DAL.DCollector.DBCollector.Instance.CallSQL1Param( "Select * from tbl_Account Where Account_ID <> " + Session["Account_ID"], true);

               rpt_account.DataBind();

            }
        }

        protected void rpt_account_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "delete")
            {
                // Xoa
                int id = Convert.ToInt32(e.CommandArgument.ToString());
                DAL.DCollector.DBCollector.Instance.StoredDelete("tbl_Account","Account_ID",id.ToString());
                Response.Redirect("/Admin/Index.aspx?panel=0&sub=1");
            }
        }
    }
}